# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaEngineRecommendationMetadata do
  @moduledoc """
  Additional information of a recommendation engine.

  ## Attributes

  *   `dataState` (*type:* `String.t`, *default:* `nil`) - Output only. The state of data requirements for this engine: `DATA_OK` and `DATA_ERROR`. Engine cannot be trained if the data is in `DATA_ERROR` state. Engine can have `DATA_ERROR` state even if serving state is `ACTIVE`: engines were trained successfully before, but cannot be refreshed because the underlying engine no longer has sufficient data for training.
  *   `lastTuneTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the latest successful tune finished. Only applicable on Media Recommendation engines.
  *   `servingState` (*type:* `String.t`, *default:* `nil`) - Output only. The serving state of the engine: `ACTIVE`, `NOT_ACTIVE`.
  *   `tuningOperation` (*type:* `String.t`, *default:* `nil`) - Output only. The latest tune operation id associated with the engine. Only applicable on Media Recommendation engines. If present, this operation id can be used to determine if there is an ongoing tune for this engine. To check the operation status, send the GetOperation request with this operation id in the engine resource format. If no tuning has happened for this engine, the string is empty.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataState => String.t() | nil,
          :lastTuneTime => DateTime.t() | nil,
          :servingState => String.t() | nil,
          :tuningOperation => String.t() | nil
        }

  field(:dataState)
  field(:lastTuneTime, as: DateTime)
  field(:servingState)
  field(:tuningOperation)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaEngineRecommendationMetadata do
  def decode(value, options) do
    GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaEngineRecommendationMetadata.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaEngineRecommendationMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
